import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import Home from '../views/Home.vue';
import Layout from '../components/Layout.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/layout',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '/',
        redirect: '/index',
      },
      {
        path: '/index',
        name: '首页',
        component: Home,
      },
      {
        path: '/article',
        name: '文章管理',
        component: () => import('@/views/Article.vue'),
        meta: {
          title: '文章管理',
        },
      },
      {
        path: '/viplist',
        name: '会员列表',
        component: () => import('@/views/VipList.vue'),
        meta: {
          title: '文章管理',
        },
      },
    ],
  },

];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
